home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Audio / Utils / AudioCompressor.h < prev   
Encoding:
C/C++ Source or Header  |  2000-06-08  |  1.6 KB  |  64 lines

  1. /* 
  2.  *  AudioCompressor.h
  3.  *
  4.  *    Copyright (C) Alberto Vigata - January 2000 - ultraflask@yahoo.com
  5.  *
  6.  *  This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
  7.  *    
  8.  *  FlasKMPEG is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2, or (at your option)
  11.  *  any later version.
  12.  *   
  13.  *  FlasKMPEG is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *   
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with GNU Make; see the file COPYING.  If not, write to
  20.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  21.  *
  22.  */
  23.  
  24. #ifndef AUDIO_COMPRESSOR_H
  25. #define AUDIO_COMPRESSOR_H
  26.  
  27. #include "..\..\Misc\CArray.h"
  28.  
  29. #define INTEGER_COMPRESSOR_SIZE 65536
  30. #define COMPRESSOR_BOTTOM       -32767
  31. #define COMPRESSOR_TOP           32768
  32.  
  33. #define DEFAULT_KNOTS 3
  34. #define DB_RANGE      92
  35. #define COMPRESSOR_STEPS 10
  36. #define DEFAULT_STEP      5
  37.  
  38. struct TKnot
  39. {
  40.     float in_dBLevel;
  41.     float out_dBLevel;
  42. };
  43.  
  44.  
  45. class CAudioCompressor
  46. {
  47.     public:
  48.         int Compress(short *data, int samples_count);
  49.         int CreateCompressor();
  50.         CAudioCompressor();
  51.         ~CAudioCompressor();
  52.  
  53.     private:
  54.         int RenderCompressor();
  55.         int AdjustKnots(int step);
  56.         CArr<TKnot>   knots;
  57.         short*        comp_lut;
  58. };
  59.  
  60.  
  61. #endif
  62.  
  63.  
  64.